7b4e1d6ec537a9e034d3e64c7f3035b25d32a7f4,zanata-war/src/test/java/org/zanata/rest/service/StatisticsServiceImplTest.java,StatisticsServiceImplTest,getContribStatsDiffUser,#,444

Before Change


        target = executeStateChangeTest(target, "test1",
                newState, person1, expectedStats);

        ContributionStatistics expectedStats2 = new ContributionStatistics();
        expectedStats2.put(username2, buildStats(target.getLocaleId(), 0, 0,
                wordCount, 0));
        target = executeStateChangeTest(target, "test2",
                newState, person2, expectedStats2);

After Change


        PersonDAO personDAO = seam.autowire(PersonDAO.class);

        String username1 = "demo";
        String username2 = "admin";
        HPerson person1 = personDAO.findByUsername(username1);
        HPerson person2 = personDAO.findByUsername(username2);

        HTextFlowTarget target = textFlowTargetDAO.findById(1L);

        int wordCount = target.getTextFlow().getWordCount().intValue();

        ContentState newState = ContentState.Approved;

        ContributionStatistics expectedStats = new ContributionStatistics(
                username1,
                Lists.newArrayList(buildStats(target.getLocaleId(), 0, 0,
                        wordCount, 0)));
        target = executeStateChangeTest(target, "test1",
                newState, person1, expectedStats);

        ContributionStatistics expectedStats2 = new ContributionStatistics(
                username2,
                Lists.newArrayList(buildStats(target.getLocaleId(), 0, 0,
                        wordCount, 0)));
        target = executeStateChangeTest(target, "test2",
                newState, person2, expectedStats2);